package camel.corp.universalcopy;

import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Handler;
import android.preference.PreferenceManager;
import android.service.quicksettings.Tile;
import android.service.quicksettings.TileService;
import android.widget.Toast;
import com.camel.corp.universalcopy.CopyTileService;
import com.camel.corp.universalcopy.I;
import com.camel.corp.universalcopy.J;
import com.crashlytics.android.Crashlytics;

public class CopyTileService extends TileService {
  private static String a = "UC_TILE_UPDATE";
  
  private BroadcastReceiver b;
  
  public static void a(Context paramContext) { paramContext.sendBroadcast(new Intent(a)); }
  
  private void b() {
    boolean bool = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getBoolean("accessibility_active", false);
    Tile tile = getQsTile();
    if (tile != null) {
      byte b1;
      if (bool) {
        b1 = 2;
      } else {
        b1 = 1;
      } 
      tile.setState(b1);
      tile.updateTile();
    } 
  }
//  "UNIVERSAL_COPY_SHOW_OVERLAY"
  public void onClick() {
    super.onClick();
    sendBroadcast(new Intent("android.intent.action.CLOSE_SYSTEM_DIALOGS"));
    // it is delayed.
    if (getQsTile().getState() == 2) {
      (new Handler()).postDelayed(new I(this), 100L);
      return;
    } 
    intent = new Intent("android.settings.ACCESSIBILITY_SETTINGS");
    intent.setFlags(268435456);
    try {
      startActivity(intent);
      Toast.makeText(this, getText(2131755217), 1).show();
      return;
    } catch (ActivityNotFoundException intent) {
      Toast.makeText(this, getText(2131755089), 0).show();
      Crashlytics.a(intent);
      return;
    } 
  }
  
  public void onStartListening() {
    super.onStartListening();
    this.b = new J(this);
    registerReceiver(this.b, new IntentFilter(a));
    b();
  }
  
  public void onStopListening() {
    super.onStopListening();
    try {
      unregisterReceiver(this.b);
      return;
    } catch (IllegalArgumentException illegalArgumentException) {
      Crashlytics.a(illegalArgumentException);
      return;
    } 
  }
}


/* Location:              D:\Users\alienware\AndroidStudioProjects\Lazero\sample\sampler\classes-dex2jar\com\camel.jar!\camel\cor\\universalcopy\CopyTileService.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       1.0.7
 */